import request from '@/utils/request'

// 查询业主合同列表
export function listHomeowners(query) {
  return request({
    url: '/fang/homeowners/allList',
    method: 'get',
    params: query
  })
}

// 查询业主合同详细
export function getHomeowners(id) {
  return request({
    url: '/fang/homeowners/' + id,
    method: 'get'
  })
}



// 新增业主
export function addHomeownersInfo(data) {
  return request({
    url: '/fang/homeowners/info',
    method: 'post',
    data: data
  })
}

// 修改业主
export function updateHomeownersInfo(data) {
  return request({
    url: '/fang/homeowners/info',
    method: 'put',
    data: data
  })
}

//查询业主合同 
export function getHomeownersContract(id) {
  return request({
    url: '/fang/homeowners/contract/'+id,
    method: 'get',
    
  })
}
///;;;;;;;;;;;;;;;;;


export function saveDraftHomeownersContract(data) {
  return request({
    url: '/fang/homeowners/save-draft',
    method: 'post',
    data: data
  })
}

export function saveHomeownersContract(data) {
  return request({
    url: '/fang/homeowners/save-contract',
    method: 'post',
    data: data
  })
}

export function deleteDraftHomeownersContract(id) {
  return request({
    url: '/fang/homeowners/delete-draft/'+id,
    method: 'delete',
    
  })
}
export function terminateHomeownersContract(id) {
  return request({
    url: '/fang/homeowners/terminate-contract/'+id,
    method: 'put',
  })
}

// 获取续期提醒内容
export function getHomeownersReminder(homeownersContractId) {
  return request({
    url: '/fang/homeowners/reminder/' + homeownersContractId,
    method: 'get'
  })
}

// 确认发送续期提醒
export function confirmHomeownersReminder(data) {
  return request({
    url: '/fang/homeowners/confirmreminder',
    method: 'post',
    data: data
  })
}




// 删除业主合同
export function delHomeowners(id) {
  return request({
    url: '/fang/homeowners/' + id,
    method: 'delete'
  })
}

